import * as actionType from './actionType'

import {
    rcDataShow
} from '../../views/RcManagement/RcEngine/axiosHttp/index'

import { dataProcessing } from '../../views/RcManagement/RcEngine/tools'

export const rcManageDataShow = (data) => ({
    type: actionType.RCMANAGEMENT,
    data,
})

// 异步处理
export const rcDataShowRequest = () => (dispatch) =>
// 发起数据获取请求
rcDataShow()
.then(res => {
    dispatch(
        rcManageDataShow(dataProcessing(res.data.data))
    )
})
.catch(err => {
    console.log(err)
})